NotateXpress 13 for ActiveX - User Guide > How To > Retrieve Annotations > Retrieve Annotations from NX XML |
Annotations in a NotateXpress™ XML file or variant are loaded using the same methods as those used for loading .nxp annotation data from file or variant:
Set the AnnotationType to NX_AnnotationType_XML, and the use the RetrieveAnnotation method to load annotations from a NotateXpress XML file. If the file is a multi-page file, set the PageNumber property to specify from which page annotations should be loaded. Attempting to load a page that does not exist will cause a PageNotFound error.
NotateXpress provides methods for retrieving the current state of annotations via Variant variables. First set the AnnotationType property is set to NX_AnnotationType_XML. Second set the PageNumber property to specify from which page annotations should be loaded. Finally use the SetAnnFromVariant method to restore annotations that are stored in a variant. To load an individual annotation layer from a variant, call the SetLayerFromVariant method.
Annotations loaded from a NotateXpress XML file may be password protected by layer. When annotations are loaded from a file or variant, the LayerRestored event is raised. Additionally, if the layer was saved with a password, the RequestLayerPassword event is raised. This provides a trigger for the application to provide the password, or display a dialog to the end user requesting the password. If the correct password is supplied during the RequestLayerPassword event, the layer is decrypted and loaded into NotateXpress.